#pragma once

#include "Event.h"

namespace My {

class Timer : public EventDispatcher {
private:
	unsigned int	m_Delay;
	HWND			m_hWnd;
	UINT_PTR		m_ID;
private:
	void CreateTimer();
	void DeleteTimer();
public:
	Timer();
	~Timer();
public:
	bool Enabled() const
		{ return m_ID != 0; }
	unsigned int Delay() const
		{ return m_Delay; }
public:
	void Enable(bool on = true);
	void SetDelay(unsigned int d);
public:
	virtual void OnTimer();
};

class TimerEvent : public Event {
public:
	Timer &		m_Timer;
	TimerEvent(Timer & t) : m_Timer(t) { }
};

} // My
